home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
033a
/
cwexp104.zip
/
EXPIRE.DOC
< prev
next >
Wrap
Text File
|
1991-10-22
|
12KB
|
269 lines
EXPIRE Version 1.03 - A DOS Waffle utility to provide news expiration
based on age of articles. Optionally, expire will also expire files in
user-specified directories.
This expire program is freeware; you may use it, modify it, or
distribute it freely. Though not required, it would be nice if you'd
give at least a little acknowledgement to the original author in any
modified version(s) you create.
DISTRIBUTION FILE:
CWEXP102.ZIP, containing expire.c, getopt.c, expire.com, and expire.doc
AUTHOR: Chris Winemiller, cwinemil@keys.lonestar.org
HISTORY:
02 April 1991 1.0 Chris Winemiller. Original version.
09 July 1991 1.01 Chris Winemiller. Corrected the "usage"
info printed out when one enters "expire -h".
Previously, the usage explained the -t option
but failed to place it in the invocation info.
(I.e., previously said "expire [-a -n]" rather
than "expire [-a -n -t -h]".) Oh--I also added
the -h option to this list. Actually, any
option other than -a, -n, or -t will cause
the usage to print out. Expanded the help output
to mention the /mexp attribute.
20 Sep 1991 1.02 Chris Winemiller. Added "-e <expire_file>"
option to name an "expire" file. This file will
contain the name of directories whose files
should be subjected to expiration. Thanks to
Bob Kirkpatrick (bobk@dogear.spk.wa.us) for
suggesting the existence and format of this file.
21 Oct 1991 1.03 Modified so that expire prints out the total
number of files and total number of bytes deleted.
These statistics are printed just before expire
terminates.
22 Oct 1991 1.04 Added a couple more statistics printed out at the
end: files per second and bytes per second that
were deleted (and total time, too).
INVOCATION:
expire [-a -e <expire_file> -n -t -h]
(NOTE: specify multiple options separately!)
where:
-a = Consider all files in each news group directory or for
expire directory for possible deletion. (Default:
consider only files whose names are composed of only
numerical characters (0-9) and no filename extension.)
-e = Name of an "expire" file. This file contains the names
of directories whose files should be subjected to
expiration. (Multiple -e options are permitted.)
-h = Help. Produces the "usage" printout.
-n = No file deletions are performed, but otherwise
produces the same output. (I.e., -n will report the
files that should be deleted, but doesn't delete
them.)
-t = Display the expiration time for each news group.
Any other attempted option produces a usage ("-h") description.
COMPILATION COMMAND (if compiling the source, using Turbo C compiler):
tcc -mt -lt expire.c getopt.c
where -mt specifies tiny model for compilation and
-lt tells the linker to produce a .COM executable.
OPTIONS THAT EXPIRE LOOKS FOR IN WAFFLE'S FORUM FILES
Expire looks for the /mexp=hh attribute in Waffle forum files, where hh
is the number of hours files will be retained. The default is 72 hours.
(That is, 72 hours will be used if no /mexp=hh attribute appears in a
forum file.) If /mexp=hh appears on a DEFAULT or FORUM line, it applies
to all following newsgroups in the forum file until changed on a later
DEFAULT or FORUM line. However, /mexp=hh on a newsgroup line applies
only to that one newsgroup, overriding the current default value.
The /dir=<directory_name> attribute is an attribute of a Waffle forum
file that is also recognized by the expire program. It is interpreted by
the expire program exactly the same way as it is interpreted by Waffle.
When /dir=<directory_name> appears on a DEFAULT or FORUM line,
<directory_name> is the name of the root directory for news. (For
example, /dir=c:/news means that all news appears under the c:/news
directory.) When /dir=<directory_name> appears on a news group line,
<directory_name> is the full pathname of the directory containing
articles for that one news group. (For example, if
/dir=c:/news/comp/os/msdos/programr appears on the line for the
newsgroup named comp.os.msdos.programmer, it names the directory
containing articles for that news group.)
(Note: The forum file names are extracted from Waffle's static file,
whose pathname is given by the WAFFLE environment variable.)
Now for an example: let's say Waffle has a forum file named USENET,
which names all the Usenet newsgroups it receives. It may look like
this:
# ------------------------- START OF USENET FILE ------------------------
# This file names the location and characteristics of various Usenet
# newsgroups that are carried here.
#
# Use /dir to specify the root of the directory tree containing
# the news. (Useful only for DOS Waffle systems.)
#
# Waffle's /keep attribute isn't used. Instead, use the /mexp
# attribute to cause news to expire according to its age.
DEFAULT /sig=sig /dir=C:/news /name="[Newsgroup %N]" /spy=monitor
# Set default expiration to 4 days (/mexp=96 hours). Other values are
# set as desired.
DEFAULT /type=USENET /new=1 /mexp=96
DEFAULT /warn=C:/waffle/system/warning /fast=1
DEFAULT /ask=Distribution,Keywords /dist=world /post=3 /read=0
alt.bbs.waffle
# Note: The Expire program will read the /dir directive; it knows
# that the alt.msdos.programmer newsgroup is in the directory named
# C:/news/alt/msdos/programr.
alt.msdos.programmer /dir=C:/news/alt/msdos/programr
# IBM binaries are important, so let's keep them around for 7 days
# (168 hours) in comp.binaries.ibm.pc
comp.binaries.ibm.pc /mod /mexp=168
# The comp.binaries.ibm.pc.d newsgroup is expired at the most recent
# default value (96 hours, or 4 days).
comp.binaries.ibm.pc.d
# Set default expirations for the following control groups. Entries
# will be kept for about a month.
DEFAULT /mexp=720
# Things that we are fed but do not carry get shoved into "junk".
# If things get placed in junk often, something is wrong. Let's
# expire its articles after 2 days (48 hours).
junk /post=9 /mexp=48
# /spy without arguments sets the "monitor" group as a destination
# for copies of any posts originating locally.. (expired after 720
# hours, which is the most recent default value).
monitor /post=0 /spy
# You *MUST* have a "control" group. Right now we don't do a whole
# lot of control messages processing in the DOS version, though.
# (Also expired after 720 hours.)
control /post=0
# ------------------------- END OF USENET FILE ------------------------
OPTIONS THAT EXPIRE LOOKS FOR IN AN EXPIRE FILE
An expire file contains a list of directories plus optional DEFAULT
lines and optional attributes. (The format of an expire file is
discussed below.) Files in those directories will be subjected to
expiration. An expire file is named by the "-e <expire_file>" option on
the command line when invoking the expire program. (Multiple "-e"
options are permitted.) If expire is invoked with no "-e" options, no
expire files are read. Expire files are considered AFTER forum files are
considered. Important Note: If you use the expire file (via the "-e"
option), you probably also want to use the "-a" option which causes all
files to be considered. Otherwise, only files with numerical file names
(like news article names!) will be considered. If this conflicts with
how you want to treat real newsgroup directories, you will simply have
to invoke expire twice: once without the -a and -e options, and once
with them.
The /mexp=hh attribute is recognized in an expire file. It has the exact
same meaning as it does in a Waffle forum file: it names the number of
hours that files will be retained. (The default is 72 hours.) If
/mexp=hh appears on a DEFAULT line, it applies to all following
directories in the expire file until changed on a later DEFAULT line.
However, if /mexp=hh appears on a line naming a directory, it applies
only to that one directory, overriding the current default expiration
time.
The /exclude=<file_names> attribute is also recognized in an expire
file. (It is NOT recognized in a Waffle forum file.) It names files to
be excluded from expire's consideration. The default is: No files are
excluded (i.e., All files are subject to expiration). If
/exclude=<file_names> appears on a DEFAULT line, it applies to all
following directories in the expire file until changed on a later
DEFAULT line. If /exclude=<file_names> appear on a line naming a
directory, it applies only to that directory and overrides the current
default /exclude.
The format of <file_names> for the /exclude option is a comma-separated
list of file names (no embedded spaces!). For example:
/exclude=sample.txt,newfile,mail.1,mail.2
NOTE: No wild card characters are recognized!
One other thing: the expression "/exclude=" (with no file names!)
means that NO files are excluded, until changed by some later
/exclude attribute. This is a handy way to get make all files
subject to expiration, after previously naming some set of files to
remain untouched. (See the example expire file below.)
THE FORMAT OF AN EXPIRE FILE
The format of an expire file is very simple. Each line is either:
1. A blank line, which is ignored.
2. A comment line (one which has a '#' character in column 1); this
line is also ignored.
3. A DEFAULT line (one whose first word is DEFAULT (upper or lower
case), with /exclude or /mexp attributes after the word DEFAULT).
4. A directory line (one which contains the full pathname of one directory,
optionally followed by /exclude or /mexp attributes).
Now for an example: let's say we have an expire file named EXPDIRS,
which names all the directories whose files we want to expire. It may
look like this (NOTE: The '#' characters MUST be in COLUMN 1 of your file!):
# ------------------------- START OF EXPDIRS FILE ------------------------
#<--- This '#' character must be in column 1 of the file!
#
# This is an expire file. It names directories which the expire
# program will consider for expiration AFTER all Waffle news groups have
# been considered.
# Let's set some defaults. Unless otherwise specified, let's retain
# files for 168 hours (1 week), and NEVER get rid of files named
# "readme.txt" or "notouch.me". (Note: file names are NOT case sensitive.)
DEFAULT /mexp=168 /exclude=readme.txt,notouch.me
c:/misc
# Waffle's outbox and /user/uucp directories fill up quickly, so
# let's expire their files after 24 hours. Also, we want to get rid
# of all files, but don't change the current defaults for /exclude.
DEFAULT /mexp=24
c:/spool/outbox /exclude=
c:/user/uucp /exclude=
# Allow users to retain their files for 2 weeks (336 hrs), and then let's
# delete them. But never get rid of files like the signature files and
# a few others.
DEFAULT /mexp=336 /exclude=join,sig,mailsig,postsig,waffle
d:/user/jackb
d:/user/donh
d:/user/billb
d:/user/root
# ------------------------- END OF EXPDIRS FILE ------------------------